ctxPath = "/education"

$("#signBtn").click(function () {
    //校验
    var customerName = $("#customerName").val();
    var customerPhone = $("#customerPhone").val();
    var customerPassword = sha256_digest($("#customerPassword").val());

    if(null == customerName || "" == customerName){
        alert("账号不能为空！");
    }

    if(null == customerPhone || "" == customerPhone){
        alert("手机号不能为空！");
    }

    if(null == customerPassword || "" == customerPassword){
        alert("密码不能为空！");
    }

    $.ajax({
        url: ctxPath + '/wx/api/customer/sign',
        type: 'post',
        dataType: 'json',
        data: {customerName: customerName, customerPhone: customerPhone, customerPassword: customerPassword},
        success: function (result) {
            if(result.returnCode == 0) {
                window.location.href = "/education/wx/member.html?token=" + result.token;
            } else {
                alert(result.returnMsg);
            }
        }
    });
})